home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1996 #15 / Monster Media Number 15 (Monster Media)(July 1996).ISO / os2 / mony_121.zip / MONY_API.H < prev    next >
C/C++ Source or Header  |  1996-03-21  |  4KB  |  116 lines

  1. // mony_api.h
  2. // 24-Jan-96 - original (chh)
  3. //  1-Feb-96 - added #ifdef __cplusplus and #ifndef __MONY_API_H (chh)
  4. // 21-Mar-96 - added comment on unnamed union use (see EMX_MONY.ZIP for alternate files)
  5.  
  6. #ifndef __MONY_API_H
  7. #define __MONY_API_H
  8.  
  9. // contains defines, structures, and prototypes
  10.  
  11. #define IOCTL_MONY      0xA1 // category code for calls to Mony DD
  12. #define IOCTL_40TH      0x40 // func code for calls to Mony DD
  13.  
  14. // structures
  15.  
  16.         // Only ax,bx,cx,dx are used (or their sub-regs).
  17.         // Pointers are passed via the parm and/or data
  18.         // args to DosDevIOCtl as shown in mony_api.c.
  19.  
  20. // I know Watcom 10 handles unnamed unions without any problems --
  21. // some other compilers don't have a clue.  If your compiler doesn't
  22. // understand this, check out the files in EMX_MONY.ZIP.
  23.  
  24. typedef struct _REGPACK {
  25.  union {
  26.   struct {
  27.    UCHAR al;
  28.    UCHAR ah;
  29.   };
  30.   USHORT ax;
  31.  };
  32.  union {
  33.   struct {
  34.    UCHAR bl;
  35.    UCHAR bh;
  36.   };
  37.   USHORT bx;
  38.  };
  39.  union {
  40.   struct {
  41.    UCHAR cl;
  42.    UCHAR ch;
  43.   };
  44.   USHORT cx;
  45.  };
  46.  union {
  47.   struct {
  48.    UCHAR dl;
  49.    UCHAR dh;
  50.   };
  51.   USHORT dx;
  52.  };
  53. } REGPACK; // IREG (or OREG)
  54. typedef REGPACK *PREGPACK;
  55.  
  56. #pragma pack(1) // it is required that this structure be 64 bytes exactly
  57.  
  58. typedef struct _BIOSDATA {
  59.  ULONG  rezPtr ;        // 00 : 0 (default values follow)
  60.  UCHAR  videoMode;      // 04 : 7
  61.  USHORT columns;        // 05 : 80
  62.  USHORT pageSize;       // 07 : 4096
  63.  USHORT startAddr;      // 09 : 0
  64.  USHORT cursorPos[8];   // 11 : 0,0 eight times (low byte=col, high=row)
  65.  UCHAR  cursorEnd;      // 27 : 0x00
  66.  UCHAR  cursorStart;    // 28 : 0x20 init value to disable cursor
  67.  UCHAR  activePage;     // 29 : 0 (0 to pages-1)
  68.  USHORT addr6845;       // 30 : 0x3B4
  69.  UCHAR  crtMode;        // 32 : 9
  70.  UCHAR  rezPalette;     // 33 : 0
  71.  UCHAR  rows;           // 34 : 25
  72.  USHORT charHeight;     // 35 : 14
  73.  UCHAR  activeDCC;      // 37 : 1
  74.  UCHAR  inactiveDCC;    // 38 : 0
  75.  USHORT colors;         // 39 : 0
  76.  UCHAR  pages;          // 41 : 1-8, depending on DEVICE= /p# option
  77.  UCHAR  rasterCode;     // 42 : 1 (348/350 scan lines)
  78.  UCHAR  rezVGA[2];      // 43 : 0,0
  79.  UCHAR  miscInfo;       // 45 : 0x04 (bit5=1 blink enabled, bit2=1 mono display)
  80.  CHAR   rezUnused[16];  // 46 : 0
  81.  USHORT monyVersion;    // 62 : driver version * 1000 (e.g., 1000 is version 1.000)
  82. } BIOSDATA; // VBD
  83. typedef BIOSDATA *PBIOSDATA;
  84. #pragma pack()
  85.  
  86. #ifdef __cplusplus
  87.    extern "C" {
  88. #endif
  89.  
  90. // prototypes of functions in mony_api.c
  91.  
  92. ULONG MonySetVideoMode (HFILE monyID, UCHAR videoMode);
  93. ULONG MonySetCursorSize (HFILE monyID, UCHAR topLine, UCHAR bottomLine);
  94. ULONG MonySetCursorPos (HFILE monyID, UCHAR page, UCHAR row, UCHAR column);
  95. ULONG MonyGetCursorStatus (HFILE monyID, UCHAR page, PUCHAR row, PUCHAR column, PUCHAR topLine, PUCHAR bottomLine);
  96. ULONG MonySetVideoPage (HFILE monyID, UCHAR page);
  97. ULONG MonyScrollUp (HFILE monyID, UCHAR lines, UCHAR attr, UCHAR r0, UCHAR c0, UCHAR r1, UCHAR c1);
  98. ULONG MonyScrollDown (HFILE monyID, UCHAR lines, UCHAR attr, UCHAR r0, UCHAR c0, UCHAR r1, UCHAR c1);
  99. ULONG MonyGetCharAttrAtCursor (HFILE monyID, UCHAR page, PUCHAR character, PUCHAR attr);
  100. ULONG MonyWriteCharAttrAtCursor (HFILE monyID, UCHAR page, UCHAR character, UCHAR attr, USHORT repCount);
  101. ULONG MonyWriteCharAtCursor (HFILE monyID, UCHAR page, UCHAR character, USHORT repCount);
  102. ULONG MonyWriteCharTTY (HFILE monyID, UCHAR page, UCHAR character);
  103. ULONG MonyGetVideoStatus (HFILE monyID, PUCHAR page, PUCHAR columns, PUCHAR videoMode);
  104. ULONG MonySetBlinkMode (HFILE monyID, UCHAR blink);
  105. ULONG MonySetBellMode (HFILE monyID, USHORT freq, USHORT duration);
  106. ULONG MonyWriteString (HFILE monyID, PSZ strgPtr, UCHAR page, UCHAR attr, UCHAR row, UCHAR col);
  107. ULONG MonyReadBlock (HFILE monyID, PVOID bufferPtr, UCHAR page, UCHAR r0, UCHAR c0, UCHAR rows, UCHAR columns);
  108. ULONG MonyWriteBlock (HFILE monyID, PVOID bufferPtr, UCHAR page, UCHAR r0, UCHAR c0, UCHAR rows, UCHAR columns);
  109. ULONG MonyGetBiosData (HFILE monyID, PBIOSDATA VBDptr);
  110.  
  111. #ifdef __cplusplus
  112.    }
  113. #endif
  114.  
  115. #endif
  116.